using System;

namespace Metar.NET
{
	/// <summary>
	/// done to give similare use as php
	/// </summary>
	public class NumberFormat
	{
        public static string number_format ( double number , int decimals)
        {
            System.Globalization.NumberFormatInfo nf=new System.Globalization.NumberFormatInfo();
            nf.NumberDecimalDigits=decimals;
            return number.ToString(nf);
        }

        public static string number_format ( double number, int decimals, string dec_point, string thousands_sep)
        {
            System.Globalization.NumberFormatInfo nf=new System.Globalization.NumberFormatInfo();
            nf.NumberDecimalDigits=decimals;
            nf.NumberDecimalSeparator=dec_point;
            nf.NumberGroupSeparator=thousands_sep;
            return number.ToString(nf);
        }
	}
}
